﻿// Sequin.Sequences.ISequenceFormatter
//
// (c) 2011 Arthur Pitman
//
// Part of the Sequin Library
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License (Version 2.1) as published by the Free Software Foundation.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License (Version 2.1) along with this library; if not, write to the 
// Free Software Foundation, Inc., 
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
// or see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sequin.Sequences
{
	/// <summary>
	/// Interface for sequence formatters
	/// i.e. objects that make human-readable strings from <see cref="Sequence"/> objects
	/// </summary>
	public interface ISequenceFormatter
	{
		/// <summary>
		/// Converts an element to a <see cref="string"/>
		/// </summary>
		/// <param name="element">The element to convert</param>
		/// <param name="symbolMapper">The <see cref="ISymbolMapper"/> to use</param>
		/// <returns>A <see cref="string"/> representation of the element</returns>
		string ElementToString(int[] element, ISymbolMapper symbolMapper);

		/// <summary>
		/// Converts a <see cref="Sequence"/> to a <see cref="string"/>
		/// </summary>
		/// <param name="sequence">The <see cref="Sequence"/> to convert</param>
		/// <param name="symbolMapper">The <see cref="ISymbolMapper"/> to use</param>
		/// <returns>A <see cref="string"/></returns>
		string SequenceToString(Sequence sequence, ISymbolMapper symbolMapper);

		/// <summary>
		/// Converts a <see cref="string"/> to an element
		/// </summary>
		/// <param name="elementString">The <see cref="string"/> to convert</param>
		/// <param name="symbolMapper">The <see cref="ISymbolMapper"/> to use</param>
		/// <returns>An element</returns>
		int[] StringToElement(string elementString, ISymbolMapper symbolMapper);

		/// <summary>
		/// Converts a <see cref="string"/> to a <see cref="Sequence"/>
		/// </summary>
		/// <param name="sequenceString">The <see cref="string"/> to convert</param>
		/// <param name="symbolMapper">The <see cref="ISymbolMapper"/> to use</param>
		/// <returns>A <see cref="Sequence"/></returns>
		Sequence StringToSequence(string sequenceString, ISymbolMapper symbolMapper);
	}
}
